VPATH += ./Task_Base ./OpenSLES ../ #包含路徑

#CC = g++

CXXFLAGS = -Wall -I ./ffmpeg/include  #重新定義g++編譯規則
LDFLAGS  = -L ./ffmpeg/lib -lavcodec-55 -lavutil-52 -lswscale-2 -lavformat-55 -lswresample-0 -lrtmp -llog -lstdc++ -Lpthread -lOpenSLES
COFLAGS	 = -MM

#path1:= $(patsubst %:,%/*.cpp ,$(VPATH))

#OBJ := $(patsubst %.cpp,%.o,$(wildcard $(path1)))

OBJ = opensles.o openslaudioimpl.o Event_Impl.o Task_Base.o Thread_Impl.o audiodecodeimpl.o audiostreamimpl.o DemuxerTask.o \ mediacoreimpl.o openslsoundtask.o streamabstract.o synchronousav.o videodecodetask.o videostreamimpl.o

LIB = libMedia.so

all: $(LIB)

$(LIB) : $(OBJ)
	$(CXX) -shared -o $(LIB) $^ $(LDFLAGS)


%.d: %.cpp
	@set -e; rm -f $@
	$(CXX) $(CXXFLAGS) $(COFLAGS) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@ ;rm -f $@.$$$$

include $(OBJ:.o=.d)

clean:
	-rm $(OBJ) $(LIB)
	@echo Clear...  $(OBJ)

